package kayao.client.data;

import java.util.Vector;

public class Subscriber {

	int mId;
	Vector<Integer> mKingdoms = new Vector<Integer>();

	public Subscriber(int id, int kingdom){
		this.mId = id;
		mKingdoms.add(kingdom);
	}
	
	public void addKingdom(Integer kingdom){
		for(int i: mKingdoms){
			if(kingdom==i)
				return;
		}
		mKingdoms.add(kingdom);
	}
	
	public void removeKingdom(Integer kingdom){
		for(int i: mKingdoms){
			if(kingdom==i)
				mKingdoms.remove(kingdom);
		}	
	}
	
	public boolean isEmpty()
	{
		if(mKingdoms.size()==0)
			return true;
		else
			return false;
	}
	
	public int getId(){
		return mId;
	}
	
	public String toString(){
		String out = "";
		out += "ID: "+mId;
		for (int i=0;i<mKingdoms.size(); i++){
			out += " kingdom: "+mKingdoms.get(i);
		}
		return out;
	}
	
}